package brushQuestions.designpattern.factory.simplefactory;

import brushQuestions.designpattern.factory.BlueTea;
import brushQuestions.designpattern.factory.FactoryConstant;
import brushQuestions.designpattern.factory.OolongTea;
import brushQuestions.designpattern.factory.Tea;

/**
 * 茶工场
 *
 * @author: mengfanbing
 * @date: 2020/6/4 9:08
 */
public class TeaFactory {
    public static Tea getInstance(String key){
        if (FactoryConstant.BLUE_TEA.equals(key)){
            return new BlueTea();
        }else if (FactoryConstant.OOLONG_TEA.equals(key)){
            return new OolongTea();
        }
        return null;
    }
}
